package com.kexin.common.exception;


import com.kexin.common.numeration.ExceptionEnum;

public class WebException extends RuntimeException{

	private static final long serialVersionUID = 1L;

	private Integer code;

    public WebException(String message) {
        super(message);
    }

    public WebException(ExceptionEnum exceptionEnum) {
        super(exceptionEnum.getMessage());
        this.code = exceptionEnum.getCode();
    }

    public WebException(String message, Throwable cause) {
        super(message, cause);
        this.code = 500;
    }

    public WebException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

}
